cc.Class({
    extends: cc.Component,

    properties: {
        autoplay:true,
        anim:cc.Animation,
    },

    onLoad(){

        this.anim = this.node.getComponent(cc.Animation);
    },

    onEnable () {

        if(this.autoplay){
  
            this.anim.resume();
            
            this.anim.play();
        }
    },

    playAnimation(){

        this.anim.play();
    },

    playAnimationByName(button,name){

        this.anim.play(name);
    },
});
